import React, { Component } from 'react'
import { connect } from 'react-redux'
import { getUserList } from '../../redux/userlist.redux'
import UserCard from '../usercard/usercard'
class Genius extends Component{

    componentDidMount(){
       this.props.getUserList("boss")
    }
    render(){    
        const dataList = this.props.userList
        console.log(dataList)
        return (
           <div>
               {dataList?<UserCard dataList={dataList}></UserCard>:null}
           </div>
        )
           
    }
}

const mapStatetoProps =(state)=>{
  return state.userlist
}

const actionCreators = {getUserList}
Genius = connect(mapStatetoProps,actionCreators)(Genius)
export default Genius